<?php 
//header("Location:http://www.google.com");
include('controllers/lib.php');;
$object=new ContentController();
$event= new EventController();
$system= new SystemController();
//$print=$system->Validate($_REQUEST);
//echo $print;
echo "TEST";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>
	<title>One Night Stand Home</title>
	<link rel="stylesheet" media="screen" type="text/css" href="style.css" />
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
   
  </head>

  <body>
    <div id="page">
	  <div id="header">
	    <div id="logo">
		<!-- type your logo and small slogan here -->
		<p>One Night Stand<span class="green"></span></p>
		<div id="slogan">
		  <p>the night everyone's got game... </p></div>
		<!-- end logo -->
		</div>
		<div id="nav">
		  <div id="nav-menu-left"></div>
		  <div id="nav-menu">
		  <!-- start of navigation -->
		    <ul>
			  <li><a href="index.php">Home</a></li>
			  <li><a href="RegisterView.php">Events</a></li>
			  <li><a href="EventView.php">Register</a></li>
			  <li><a href="AboutView.php">About the Event</a></li>
			  <li><a href="SponsorView.php">Sponsors</a></li>
			  <li></li>
			</ul>
			<!-- end navigation -->
          </div>
		  <div id="nav-menu-right"></div>
		</div>
	  </div>
	  <div class="clearfloats"></div>
	  <div id="header2">
	    <!-- the large header slogan which is over top of the grass image can either be changed, or removed below -->
	    <div id="header2-slogan1"></div>
	    <div id="header2-slogan2"><p>&nbsp;</p></div>
	    <!-- end header slogan -->
	  </div>
	  
	  <div id="content">
	    <div class="content-padding">
		  <!-- page content below -->
	      <?php
		  if($system->Validate($_REQUEST))
			{
         			 //Note, email is actually gt user name
					 if($system->checkExistingRegistration($_REQUEST[id], $_REQUEST[type], $_REQUEST[gtuser0]))
					 {
					 	if($system->checkSpots($_REQUEST[id], $_REQUEST[type])>0)
						{
							echo "<h1>Are You Sure You Want To Register for ".$event->getName($_REQUEST[id], $_REQUEST[type])." ?</h1>";
							$_SESSION[currentQuery]=$_REQUEST;
							$_SESSION[permission]="granted";
							echo "<a href='ThankYouView.php'>Yes</a><br>";
							echo "<a href='index.php'>No</a>";
						}
						else
						{
							echo "<h1>You came a little too late... to register.</h1>"; 
							echo "<p>We are sorry to say that we are out of spots for this event, but don't let that discourage your from signing up for another event. ";
							echo "Also, you can check back to see if we open up any more spots as we get closer to the event. If you believe this is a mistake, please contact <a href='mailto:ryan.fahsel@gmail.com'>Ryan Fahsel.</a></p> ";
						}
						
					 }
					 else
					 {
						echo "<h1>Only One, One Night Stand For You...</h1>"; 
						echo "<p>It appears that you have already signed up for this event! If you believe this is an error, please contact <a href='mailto:ryan.fahsel@gmail.com'>Ryan Fahsel.</a> ";
					 }
					 
			}
		   else
		   {
					echo "<h1>Houston, we have a problem...</h1>"; 
					echo "<p>We are sorry to inform you there was a problem with your registration. Please click the back button ";
					echo "on your brower. Check your input for blank fields, and then try resubmitting. If you believe this is an error, please contact <a href='mailto:ryan.fahsel@gmail.com'>Ryan Fahsel.</a> ";
		   }
			?>
     

       
	    </div>
	  </div>
	  <div id="body-divider"></div><!-- the division between the light green content section, and the dark -->
	  <div id="content2">
	    <div class="content-padding">
		  <!-- content blocks (three side by side), can remove if needed, this was just an example -->
		  <div class="content2-block"></div>
		  <div class="content-divider"></div>
		  <div class="content2-block">
		    <h3><em><strong><?php $object->getFooterTitle()?></strong></em></h3>
		    <p><?php $object->getFooter()?><</p>
		  </div>
		  <div class="content-divider"></div>
		  <div class="clearfloats"></div>
		</div>
      </div>
	  <div id="footer-div"></div>
	  <div id="footer">
	    <p>Website &copy; Copyright FreShGA 2010, All rights reserved. <a href="http://www.steves-templates.com">website templates</a></p>
	  </div>
	</div>
  </body>
</html>